public class Test {

    static final String str = "这是一个字符串";//final修饰的无法重新赋值
    static int a = 12;
    static final String name = "LC";
    public static final String TAG = "TagA";

    public static void main(String[] args) {
//        System.out.println("Hello,world");
        System.out.println("Hello:" + name + "!");
        PersonJava personJava = new PersonJava("LC");
        System.out.println(personJava.getName());

        Person person = new Person("LC", 12);
        System.out.println(person.getName());
        person.setAge(12);
        person.getAge();
        System.out.println(getLastString("asd"));

    }

    public static int max(int a, int b) {
        if (a > b) {
            return a;
        } else {
            return b;
        }
    }

    //    List list = new ArrayList();
    public String getColorsStr(ColorsJava colorsJava) {
        String str = null;
        switch (colorsJava) {
            case RED:
                str = "红色";
                break;
            case BLUE:
                str = "蓝色";
                break;
            case ORANGE:
                str = "橙色";
                break;
            case YELLOW:
                str = "黄色";
                break;
            case GREEN:
                str = "绿色";
                break;
        }

        //通过父类来new出一个子类
        Animal a = new Dog();
        if (a instanceof Dog) {
            //如果new出的对象属于子类,则可以调用子类方法
            ((Dog) a).dig();
        }


        return str;
    }

    public static Character getLastString(String str) {
        return str.charAt(str.length() - 1);
    }
}